Skip to content

fix(workbuddy): sanitize Claude Code billing attribution headers - #482

Merged
caigee-cmd merged 1 commit into
mainfrom
fix/workbuddy-billing-header-sanitize
Nov 10, 2026
Merged

caigee-cmd merged 1 commit into
mainfrom
fix/workbuddy-billing-header-sanitize

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

Summary

  • Add x-anthropic-billing-header and x-anthropic-billing-hdr to the existing WorkBuddy WAF request-body sanitizer (sanitizeFingerprintText / sanitizeWAFKeywords in payload.go)
  • Both spellings are stripped as a whole line (including trailing cch= params), with the embedded and bare-key fallbacks from hub #855 / v2.0.8
  • A system/developer message that is only that header is dropped via the existing empty-message cleanup, and ensureLeadingSystem restores a non-empty leading system prompt if needed (avoids 400 / 11151)
  • Regression tests cover both keys, case-insensitivity, other fields left untouched, header-only system drop, and the PrepareBody outbound path

Aligns with workbuddy2api-hub #855 (landed in v2.0.8, tip 7ffba72). Claude Code 2.1.37+ injects these reserved keys into the first system text block; sending them as-is is rejected with 400 / 11128.

Out of scope

  • orphan call_id, tool_search, gpt-image-2.6, SIWC, cloak, Muse
  • Qoder tool stream
  • CPA 714f052 image_generation injection pipeline
  • domestic desktop or conversation CLIVersion
  • panel / usage cache

Test plan

  • go test ./internal/providers/workbuddy/ -count=1
  • go vet ./internal/providers/workbuddy/
  • python3 scripts/release-notes.py validate
  • Confirm merge/release wait for separate user nod; do not deploy SGP3

Strip x-anthropic-billing-header and x-anthropic-billing-hdr from the
existing WorkBuddy WAF request-body sanitizer (hub #855 / v2.0.8) so
these reserved keys are not sent upstream as-is (400 / 11128). A
system message that is only that header is dropped, and a leading
system prompt is restored if needed to avoid empty content (11151).
@caigee-cmd
caigee-cmd merged commit 094b8bc into main Nov 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant